﻿// MIT License
// 开源地址：https://gitee.com/co1024/AbcMvc
// Copyright (c) 2021-2022 1024
// Abc.Mvc=Furion+EF+SqlSugar+Pear layui admin.

namespace Abc.Application.HtAdminServices;

/// <summary>
/// ServiceMapper
/// </summary>
public class HtMenuMapperOut : IRegister
{
    public void Register(TypeAdapterConfig config)
    {
        // 示例
        //config.ForType<__EFMigrationsHistory,__EFMigrationsHistoryDto>()
        //.Map(dest => dest.MigrationId, src => src.MigrationId)//
        //.Map(dest => dest.ProductVersion, src => src.ProductVersion)//
        //;

        // Description 菜单表
        config.ForType<SysMenu, HtMenuOut>()
          //.Map(dest => dest.Id, src => src.Id)// ID
          //.Map(dest => dest.Name, src => src.Name)// 菜单名称
          //.Map(dest => dest.Icon, src => src.Icon)// 图标
          //.Map(dest => dest.Sort, src => src.Sort)// 顺序
          //.Map(dest => dest.Url, src => src.Url)// Url
          //.Map(dest => dest.Remark, src => src.Remark)// 备注
          //.Map(dest => dest.IsExpand, src => src.IsExpand)// 是否展开菜单
          //.Map(dest => dest.IsExpandName, src => src.IsExpand?"是":"否")// 是否展开菜单
          //.Map(dest => dest.MenuType, src => src.MenuType)// 节点类型(菜单、工具栏)
          //.Map(dest => dest.CreatorUserId, src => src.CreatorUserId)// 创建用户ID
          //.Map(dest => dest.CreatorUserName, src => src.CreatorUserName)// 创建用户
          //.Map(dest => dest.CreationTime, src => src.CreationTime.ToString("yyyy-MM-dd HH:mm:ss"))// 创建时间
          //.Map(dest => dest.UpdateUserId, src => src.UpdateUserId)// 更新用户ID
          //.Map(dest => dest.UpdateUserName, src => src.UpdateUserName)// 更新用户
          //.Map(dest => dest.UpdateTime, src => src.UpdateTime!=null?src.UpdateTime.Value.ToString("yyyy-MM-dd HH:mm:ss"):"")// 更新时间
          //.Map(dest => dest.IsDeleted, src => src.IsDeleted)// 默认假删除
          //.Map(dest => dest.IsDeletedName, src => src.IsDeleted?"是":"否")// 默认假删除
          //.Map(dest => dest.DeletedUserId, src => src.DeletedUserId)// 删除用户ID
          //.Map(dest => dest.DeletedUserName, src => src.DeletedUserName)// 删除用户
          //.Map(dest => dest.DeletedTime, src => src.DeletedTime!=null?src.DeletedTime.Value.ToString("yyyy-MM-dd HH:mm:ss"):"")// 删除时间
          //.Map(dest => dest.IsDisuse, src => src.IsDisuse)//
          //.Map(dest => dest.IsDisuseName, src => src.IsDisuse?"是":"否")//
          //.Map(dest => dest.IsSystem, src => src.IsSystem)// 是否系统菜单
          //.Map(dest => dest.IsSystemName, src => src.IsSystem?"是":"否")// 是否系统菜单
          //.Map(dest => dest.IsShow, src => src.IsShow)// 是否显示
          //.Map(dest => dest.IsShowName, src => src.IsShow?"是":"否")// 是否显示
          //.Map(dest => dest.Code, src => src.Code)// 菜单ID
          .Map(dest => dest.PCode, src => src.PCode ?? "")// 父Id
                                                          //.Map(dest => dest.IsEnable, src => src.IsEnable)// 是否可用
                                                          //.Map(dest => dest.IsEnableName, src => src.IsEnable?"是":"否")// 是否可用
                                                          //.Map(dest => dest.OpenType, src => src.OpenType)//
      ;
    }
}